package com.wangmin.intercept.reciver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.wangmin.intercept.bean.ProtocalMsg;
import com.wangmin.intercept.utils.LogUtils;

import de.greenrobot.event.EventBus;
/**
 * Created by wm on 2016/12/17.
 */

public class MyBroadCastReciver extends BroadcastReceiver {
    public static String action = "action";
    @Override
    public void onReceive(Context context, Intent intent) {
        String data = intent.getStringExtra("url");
        if(data == null){
            return;
        }
//        DLIntent activityIntent = new DLIntent();
//        activityIntent.setClass(null,CommonLoadWebviewActivity.class);
//        activityIntent.putExtra("url",data);
//        activityIntent.stFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        LogUtils.getNewInstance("MyBroadCastReciver").dob("开始发送到activity");
        ProtocalMsg protocalMsg = new ProtocalMsg("ok",1,data);
        EventBus.getDefault().post(protocalMsg);
    }
}
